<?php
/**
 * @package		Joomla.Site
 * @subpackage	mod_menu
 * @copyright	Copyright (C) 2005 - 2012 Open Source Matters, Inc. All rights reserved.
 * @license		GNU General Public License version 2 or later; see LICENSE.txt
 */

// No direct access.
defined('_JEXEC') or die;

?>
<h3><?php echo ($module->showtitle) ? $module->title : "Category";?></h3>
<div class="categories-list">
<?php 

	$db	=& JFactory::getDBO();	
	$itemid = JRequest::getVar( 'Itemid' );

	foreach ($list as $anItem){
		$class = ($active_id == $anItem->id) ? 'class="current"' : "";
		$mainlinkb = (!empty($anItem->flink) || $anItem->type != 'separator') ? "href='".$anItem->flink."'" : '';
?>
	<ul>
	<li><h4><a class="bottom-menu" style="cursor: pointer" <?php echo $mainlinkb?>><span><?php echo $anItem->title?></span></a></h4></li>
	<?php 
	/*$qs = "SELECT * FROM `#__menu` WHERE menutype = '".$menutype."' AND published = 1 AND parent_id = ".$anItem->id;	
	$db->setQuery( $qs );
	$submenub = $db->loadObjectList();*/
	$submenu = modMenuHelper::getListMenuByID($anItem->id, $menutype);
	if ($submenu){
		foreach ($submenu as $item){
			$subclass = '';
			if ($itemid == $item->id) {
				$subclass = 'class="current"';
			}
			
			$sublinkb = (!empty($item->flink) || $item->type != 'separator') ? "href='".$item->flink."'" : '';
			?>
			<li><a <?php echo $subclass?> <?php echo $sublinkb?>><?php echo $item->title?></a></li>			
			<?php
		}
	}
	?>
	</ul>
	<?php 
}
//} 
?>	
</div>